src_s=request_server.cpp
bin_s=request_server
src_c=request_client.cpp
bin_c=request_client

proto_file=request.proto
proto_pb=request.pb

code_cc_pathfile=../include/muduo/proto/codec.cc


all: $(bin_s) $(bin_c)
$(bin_c): $(src_c) $(proto_pb).cc $(code_cc_pathfile)
	g++ $^ -o $@ -std=c++11 -I../include -L../lib -lmuduo_net -lmuduo_base -lprotobuf -lz
$(bin_s): $(src_s) $(proto_pb).cc $(code_cc_pathfile)
	g++ $^ -o $@ -std=c++11 -I../include -L../lib -lmuduo_net -lmuduo_base -lprotobuf -lz

.PHONY: clean create_proto clean_proto run_s run_c
clean:
	rm -f $(bin_s) $(bin_c)
create_proto:
	protoc --proto_path=./ --cpp_out=./ $(proto_file)
clean_proto:
	rm -f $(proto_pb)*
run_s:
	./$(bin_s)
run_c:
	./$(bin_c)